package com.shop.api.feign;

import java.util.List;

import com.shop.pojo.LdbzIndexRecommendAd;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author 作者:  郝炳凯
 */
@FeignClient(name = "shop-service-advertisement")
public interface IndexRecommendAdFeign {

    /**
     * 获取索引推荐广告页面
     * @param entity
     * @param start
     * @param limit
     * @return
     */
    @RequestMapping(value = "/index/recommend/ad/getIndexRecommendAdPage", method = RequestMethod.GET)
    List<LdbzIndexRecommendAd> getIndexRecommendAdPage(@RequestParam("entity") LdbzIndexRecommendAd entity, @RequestParam("start") int start, @RequestParam("limit") int limit);

    /**
     * 获取索引推荐广告数量
     * @param entity
     * @return
     */
    @RequestMapping(value = "/index/recommend/ad/countByEntity", method = RequestMethod.GET)
    long countByEntity(@RequestParam("entity") LdbzIndexRecommendAd entity);

    /**
     * 根据id获取索引推荐广告
     * @param id
     * @return
     */
    @RequestMapping(value = "/index/recommend/ad/selectByKey/{id}", method = RequestMethod.GET)
    LdbzIndexRecommendAd selectByKey(@RequestParam("id") Long id);

    /**
     * 更新索引推荐广告
     * @param entity
     * @return
     */
    @RequestMapping(value = "/index/recommend/ad/updateByKey", method = RequestMethod.GET)
    int updateByKey(@RequestParam("entity") LdbzIndexRecommendAd entity);

    /**
     * 获取索引推荐广告
     * @return
     */
    @RequestMapping(value = "/index/recommend/ad/getIndexRecommendAdByRedis", method = RequestMethod.GET)
    List<LdbzIndexRecommendAd> getIndexRecommendAdByRedis();

}
